SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].gspAccount_UPDATE
(
@accountId int = null,
@userName nvarchar(100) = null,
@email nvarchar(100) = null,
@password nvarchar(128) = null,
@passwordSalt nvarchar(128) = null,
@lastLoginDate datetime = null,
@lastLoginIp nvarchar(40) = null,
@isActivated bit = null,
@isLockedOut bit = null,
@lastLockedOutDate datetime = null,
@lastLockedOutReason nvarchar(256) = null,
@newPasswordKey nvarchar(128) = null,
@newPasswordRequested datetime = null,
@newEmail nvarchar(128) = null,
@newEmailKey nvarchar(128) = null,
@newEmailRequested datetime = null,
@comments nvarchar(256) = null,
@createdDate datetime = null,
@lastModifiedDate datetime = null
)
AS

UPDATE
  [dbo].[Account]
SET
  [UserName] = @userName,
  [Email] = @email,
  [Password] = @password,
  [PasswordSalt] = @passwordSalt,
  [LastLoginDate] = @lastLoginDate,
  [LastLoginIp] = @lastLoginIp,
  [IsActivated] = @isActivated,
  [IsLockedOut] = @isLockedOut,
  [LastLockedOutDate] = @lastLockedOutDate,
  [LastLockedOutReason] = @lastLockedOutReason,
  [NewPasswordKey] = @newPasswordKey,
  [NewPasswordRequested] = @newPasswordRequested,
  [NewEmail] = @newEmail,
  [NewEmailKey] = @newEmailKey,
  [NewEmailRequested] = @newEmailRequested,
  [Comments] = @comments,
  [CreatedDate] = @createdDate,
  [LastModifiedDate] = @lastModifiedDate
WHERE
  [AccountId] = @accountId


GO
